package com.acme.task5;

public class TextModifier {
	public static void main(String[] args) {
		if (args.length == 0)
			throw new IllegalArgumentException("There must be String input");
		System.out.println(modifyText(args[0]));
	}
	
	public static String modifyText(String text) {
		StringBuilder result = new StringBuilder(); 
		for (int i = 0; i < text.length(); i++) {
			char charAtIndex = text.charAt(i);
			if (Character.isDigit(charAtIndex))
				continue;
			result.append(charAtIndex);
			if ('+' == charAtIndex || '-' == charAtIndex) {
				result.append(charAtIndex);
			}
		}
		return result.toString();
	}
}
